Skip to content

Conversation

@Nialixus
Copy link

This PR introduces a new loadingBuilder callback in PdfPageView and SfPdfViewer to allow
custom PDF loading widgets, similar to other Syncfusion components.

Called to build a custom widget while a PDF page is loading.

If this property is set, the returned widget will replace the default
page loading indicator in [SfPdfViewer].

Defaults to null.

This example demonstrates how to show a custom loading widget in the [SfPdfViewer].

class MyAppState extends State<MyApp> {
  final GlobalKey<SfPdfViewerState> _pdfViewerKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Syncfusion Flutter PDF Viewer'),
      ),
      body: SfPdfViewer.network(
        'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
        key: _pdfViewerKey,
        loadingBuilder: (context) {
          return const Center(
            child: CircularProgressIndicator(),
          );
        },
      ),
    );
  }
}

@VijayakumarMariappan VijayakumarMariappan added pdf viewer PDF viewer component open Open labels Nov 18, 2025
@immankumarsync
Copy link
Collaborator

Hi @Nialixus,

At present, Syncfusion Flutter PDF Viewer does not have the built-in support to customize the document loading indicator and page loading indicator. We don't have any immediate plans to implement this support. At the planning stage of every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know here when this feature implementation is started in the future.

The document loading indicator can be customized at the sample level using the code below,

  1. Wrap the SfPdfViewer in Stack widget
  2. Show a loading indicator on top of SfPdfViewer widget
  3. Using the onDocumentLoaded, the loading indicator can be removed from the widget tree.
class _HomePage extends State<HomePage> {
  final GlobalKey<SfPdfViewerState> _pdfViewerKey = GlobalKey();

  bool _isDocumentLoaded = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Syncfusion Flutter PDF Viewer')),
      body: Stack(
        children: [
          SfPdfViewer.network(
            'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
            key: _pdfViewerKey,
            onDocumentLoaded: (_) => setState(() => _isDocumentLoaded = true),
          ),
          if (!_isDocumentLoaded) // Show the custom loading indicator
            Container(
              color: Colors.white,
              child: const Center(child: CircularProgressIndicator()),
            ),
        ],
      ),
    );
  }
}

Regards,
Imman Kumar P

@immankumarsync immankumarsync added waiting for customer response Cannot make further progress until the customer responds. workaround available Workaround available to overcome the query and removed open Open labels Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pdf viewer PDF viewer component waiting for customer response Cannot make further progress until the customer responds. workaround available Workaround available to overcome the query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants